<%@page import="code.CodeDTO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="code.CodeDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<% request.setCharacterEncoding("UTF-8"); %>    

<jsp:useBean id="dto" class="code.CodeDTO" />
<jsp:setProperty property="*" name="dto"/>
<%
CodeDAO dao = new CodeDAO();
dao.setDto(dto);
System.out.println("find : "+dto.getSrchWord());
// dto.setSrchWord("tt");
ArrayList<CodeDTO> srchList = dao.cdSrch(dto.getSrchWord());
%>

<table class="table" id="srchTable"
		style="width: 1200px; margin: 20px auto 10px auto;">
		<thead style="background-color: #e5e5e5;">
			<tr>
				<!-- <th>선택</th> -->
				<th>업무대분류</th>
				<th>업무소분류</th>
				<th>코드</th>
				<th>등록자</th>
				<th>등록일</th>
				<th>수정자</th>
				<th>수정일</th>
				<th>사용여부</th>
			</tr>
		</thead>
		<tbody class="table table-hover" align="center" id="cd_tbody">
		
		<%
		System.out.println("list : "+srchList.size());
		for(int i=0; i<srchList.size(); i++){
			CodeDTO srchResult = srchList.get(i);
			
		%>
			<tr id="<%=srchResult.getCd_grp1() %><%=srchResult.getCd_grp2() %>" onclick="test('<%=srchResult.getCd_grp1() %>'
																						 , '<%=srchResult.getCd_grp1_nm() %>'
																						 , '<%=srchResult.getCd_grp2() %>'
																						 , '<%=srchResult.getCd_grp2_nm() %>'
																						 , '<%=srchResult.getCd_grp1() %><%=srchResult.getCd_grp2() %>'
																						 , '<%=srchResult.getCd_st() %>'
																						 , '<%=srchResult.getRg_pp() %>'
																						 , '<%=srchResult.getRg_dt() %>'
																						 , '<%=srchResult.getMd_pp() %>'
																						 , '<%=srchResult.getMd_dt() %>')">
				<!-- <td><input type="radio"></td> -->
				<td><%=srchResult.getCd_grp1_nm() %></td>
				<td><%=srchResult.getCd_grp2_nm() %></td>
				<td><%=srchResult.getCd_grp1() %><%=srchResult.getCd_grp2() %></td>
				<td><%=srchResult.getRg_pp() %></td>
				<td><%=srchResult.getRg_dt() %></td>
				<td><%=srchResult.getMd_pp() %></td>
				<td><%=srchResult.getMd_dt() %></td>
				<td><%=srchResult.getCd_st() %></td>
			</tr>
			<%} %>
		</tbody>
	</table> 